<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'Genesis Tours',
	'defaultController'=>'intro',

	// preloading 'log' component
	'preload'=>array('log'),

	// autoloading model and component classes
	'import'=>array(
		'application.helpers.*',
		'application.models.*',
		'application.modules.admin.models.*',
		'application.components.*',
	),

	// application components
	'components'=>array(
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning'
				),
			),
		),
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
		),
		// uncomment the following to set up database
		
		'db'=>array(
			'connectionString'=>'mysql:host=localhost;dbname=genesistours',
			'username' => 'root',
            'password' => 'root',
			'charset'=>'utf8'
		),
		'urlManager'=>array(
            'urlFormat'=>'path',
			'showScriptName'=>false,
			'rules'=>array(
                'admin/page/<_alias:\w+>' => 'admin/page/edit/alias/<_alias>',
				'admin/page/update/<_alias:\w+>' => 'admin/page/update/alias/<_alias>',
		
				'hotel/city/<_cityid:\w+>' => 'hotel/index/cityid/<_cityid>',
				'excursion/type/<_excursionTypeId:\w+>' => 'excursion/index/excursionTypeId/<_excursionTypeId>',
		
				'<_alias:(transfer|vip|about|pamyatka|contacts)>' => 'page/index/alias/<_alias>'
            ),
        ),
        'image'=>array(
			'class'=>'application.extensions.image.CImageComponent',
            // GD or ImageMagick
            'driver'=>'GD',
            // ImageMagick setup path
            'params'=>array('directory'=>'/opt/local/bin'),
        )
	),
	'modules' => array(
		'admin' => array(
			'layout' => 'main'
		)
	),
	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>array(
		// this is used in contact page
		'adminEmail'=>'webmaster@example.com',
	),
);